package com.opentae.data.mall.interfaces;

import com.opentae.core.mybatis.config.MyBatisRepository;
import com.opentae.core.mybatis.mapper.Mapper;
import com.opentae.data.mall.beans.MallWallet;
import com.opentae.data.mall.pojo.WalletSum;
import org.apache.ibatis.annotations.Param;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;

/**
 * 
 * Created by exampleCreater.
 */
@MyBatisRepository("tae_mall_mallWalletMapper")
@Scope("singleton")
@Lazy(true)
public interface MallWalletMapper extends Mapper<MallWallet> {
    /**
     * @description 根据用户id 查询用户账户信息
     * @author 郭尔
     * @date 2019/2/14 15:26
     */
    MallWallet selByUserId(@Param("userId") Long userId);

    /**
     *
     * @description 修改用户金额
     * @author 郭尔
     * @date 2019/2/14 15:26
     */
    int changeMoney(@Param("userId") Long userId,@Param("changeValue")Double changeValue);

    /**
     *
     * @description 修改用户金额
     * @author 郭尔
     * @date 2019/2/14 15:26
     */
    int changeVoucher(@Param("userId") Long userId,@Param("changeValue")Double changeValue);

    /**
     *
     * @description 修改用户邀请的收益
     * @author 郭尔
     * @date 2019-11-11 17:50
     */
    int changeInviteReward(@Param("userId") Long userId,@Param("changeValue")Double changeValue);


    /**
     *
     * @description 修改累计收益
     * @author 郭尔
     * @date 2019-05-18 11:08
     */
    int changeTotal(@Param("userId")Long userId, @Param("changeValue")Double changeValue);

    //
        WalletSum getWalletMoney();
}
